package com.own.business.exam.business.service.impl;

import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.own.business.exam.business.service.ExamRuleQuestionService;
import com.own.business.exam.entity.bo.ExamRuleQuestionBo;
import com.own.business.exam.entity.map.ExamRuleQuestionMapVo;
import com.own.business.exam.entity.po.ExamRuleQuestion;
import com.own.business.exam.entity.query.ExamRuleQuestionQuery;
import com.own.business.exam.entity.vo.ExamRuleQuestionVo;
import com.own.business.exam.mapper.ExamRuleQuestionMapper;
import com.own.component.common.base.service.impl.AbstractBaseBindTwoService;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * ExamRuleQuestionServiceImpl
 *
 * @author chenxueli
 * @date 2021/05/18 14:43:47
 */
@Slf4j
@Service
public class ExamRuleQuestionServiceImpl extends AbstractBaseBindTwoService<
        ExamRuleQuestion,
        ExamRuleQuestionBo,
        ExamRuleQuestionVo,
        ExamRuleQuestionMapVo,
        ExamRuleQuestionQuery,
        ExamRuleQuestionMapper
        > implements ExamRuleQuestionService {

    /**
     * 获取pk的属性
     *
     * @return pk的属性
     */
    @Override
    public SFunction<ExamRuleQuestion, Long> getPkExtractor() {
        return ExamRuleQuestion::getFkRuleId;
    }

    /**
     * 获取fk的属性
     *
     * @return fk的属性
     */
    @Override
    public SFunction<ExamRuleQuestion, Long> getFkExtractor() {
        return ExamRuleQuestion::getFkQuestionId;
    }

    /**
     * 创建新的对象
     *
     * @param pk 主id
     * @param fk 副id
     * @return 新对象
     */
    @Override
    public ExamRuleQuestion buildPo(@NonNull Long pk, @NonNull Long fk) {
        return new ExamRuleQuestion();
    }

}
